<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="h" uri="/syzg-html"%>
<% 
	String realPath = request.getContextPath();  
%>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
	src="<%=realPath%>/baseNew/plugins/bootstrap-treeview/bootstrap-treeview.min.js"></script>
<link
	href="<%=realPath%>/baseNew/plugins/bootstrap-treeview/bootstrap-treeview.min.css"
	rel="stylesheet" />
</head>
<body>
	<div class="modal fade bs-example-modal-lg" id="treeNewsColumnsViewModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg" role="document" style="width: 400px;height: 400px;">
			<div class="modal-content" style="width: 400px;height: 400px;">
				<div class="modal-header">
					<h4 class="modal-title" id="myModalLabel">栏目树</h4>
				</div>
				<div class="modal-body" id="modalCore" style="width: 400px;height: 280px;">
					<div id="treeNewsColumns" style="height: 250px;overflow-x:hidden;"></div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" onclick="closeNewsColumnsWindow()">关闭</button>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	
		/**
		* 关闭当前窗口
		*/
		function closeNewsColumnsWindow(){
			ModalUtil.hideModal("treeNewsColumnsViewModal");
		}
		
		/**
		* 加载数据
		*/
		function loadNewsColumnsData() { 
		//alert("<%=realPath%>/path/newscolumns/loadtreenewscolumns");
			$.post("<%=realPath%>/path/newscolumns/loadtreenewscolumns", {},
				function(result) {
					if (result.state == 'Success') {
						$('#treeNewsColumns').treeview({
							data : result.content,
							levels : 5,
							nodeIcon:"glyphicon glyphicon-stop",
							onNodeSelected: function(event, data) {
					 	 		setColumnsValue(data);
					 	 		closeNewsColumnsWindow();
					 	 	}
						});
					} else {
						bootbox.alert("<h4>操作失败,原因："+result.content+"</h4>", function() {
							closeNewsColumnsWindow();
						});
					}
				}
			);
		}
		
		/**
		* 加载数据
		*/
		function loadNewsColumnsData2() { 
		//alert("<%=realPath%>/path/newscolumns/loadtreenewscolumns");
			$.post("<%=realPath%>/path/newscolumns/loadtreenewscolumns", {},
				function(result) {
					if (result.state == 'Success') {
						$('#treeNewsColumns').treeview({
							data : result.content,
							levels : 5,
							nodeIcon:"glyphicon glyphicon-stop",
							onNodeSelected: function(event, data) {
					 	 		setColumnsValue2(data);
					 	 		closeNewsColumnsWindow();
					 	 	}
						});
					} else {
						bootbox.alert("<h4>操作失败,原因："+result.content+"</h4>", function() {
							closeNewsColumnsWindow();
						});
					}
				}
			);
		}
	</script>
</body>
</html>